package com.ming.closeto.utils;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;


public class ProcessUtils {

    /**
     * 获取主进程
     * @return
     */
    public static String getTopProcess() {
        try {
            File file = new File("/proc/" + android.os.Process.myPid() + "/" + "cmdline");
            BufferedReader bf = new BufferedReader(new FileReader(file));
            String processName = bf.readLine().trim();
            bf.close();
            return processName;
        } catch (Exception e) {
            return null;
        }
    }
}
